package com.example.shopping.service;

import com.example.shopping.dao.ISpecificationDao;
import com.example.shopping.pojo.Specification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

/*
Create by 苍狼 于 2020/1/16
站在巅峰看世界，
落在深渊思人生。
*/
@Service
public class SpecificationServiceImpl implements SpecificationService {
    @Autowired(required = false)
    private ISpecificationDao specificationDao;

    @Override
    public List<Specification> selectSpecification() {
        return specificationDao.selectSpecification();
    }

    @Override
    public int insertSpecification(Specification specification) {
        return specificationDao.insertSpecification(specification);
    }

    @Override
    public int deleteSpecification(int id) {
        return specificationDao.deleteSpecification(id);
    }

    @Override
    public List<Specification> quertByLikespecName(String specName) {
        return specificationDao.quertByLikespecName(specName);
    }

    @Override
    public Specification selectByOneSpecification(int id) {
        return specificationDao.selectByOneSpecification(id);
    }

    @Override
    public int updateSpecificationById(int id) {
        return specificationDao.updateSpecificationById(id);
    }
}
